import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown=true)
public class Person {

    private static final String MESSAGE = "SB";

    private String name;
    private int age;
    private String[] hobbies;

    //构造
    public Person(String name, int age, String[] hobbies) {
        this.name = name;
        this.age = age;
        this.hobbies = hobbies;
    }

    //setter
    public void setName(String name) {
        this.name = name;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public void setHobbies(String[] hobbies) {
        this.hobbies = hobbies;
    }

    //getter

    public String getName() {
        return name;
    }
    public int getAge() {
        return age;
    }
    public String[] getHobbies() {
        return hobbies;
    }


    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("[");
        for(String hobby : hobbies) {
            builder.append(hobby+",");
        }
        builder.delete(builder.length()-1, builder.length());
        builder.append("]");
        return "{name:"+name+",age:"+age+",hobbies:"+builder.toString()+"}";
    }

}
